# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html

import scrapy

from components.custom_item import UpdateCustomItem


class NetThsListedCompanyCashflowItem(UpdateCustomItem):
    __update_key__ = [
        "project_name",
        "currency_unit",
        "report_type",
        "years",
        "amount",
        "index_col",
        "company_name",
        "securities_code",
        "fullname",
        "taxpayer_id",
    ]
    __table_name__ = 'net_ths_listed_company_cashflow'

    project_name = scrapy.Field()
    currency_unit = scrapy.Field()
    report_type = scrapy.Field()
    years = scrapy.Field()
    amount = scrapy.Field()
    index_col = scrapy.Field()
    company_name = scrapy.Field()
    securities_code = scrapy.Field()
    fullname = scrapy.Field()
    taxpayer_id = scrapy.Field()


class NetThsListedCompanyBalanceItem(UpdateCustomItem):
    __update_key__ = [
        "project_name",
        "currency_unit",
        "report_type",
        "years",
        "amount",
        "index_col",
        "company_name",
        "securities_code",
        "fullname",
        "taxpayer_id",
    ]
    __table_name__ = 'net_ths_listed_company_balance'

    project_name = scrapy.Field()
    currency_unit = scrapy.Field()
    report_type = scrapy.Field()
    years = scrapy.Field()
    amount = scrapy.Field()
    index_col = scrapy.Field()
    company_name = scrapy.Field()
    securities_code = scrapy.Field()
    fullname = scrapy.Field()
    taxpayer_id = scrapy.Field()


class NetThsListedCompanyProfitItem(UpdateCustomItem):
    __update_key__ = [
        "project_name",
        "currency_unit",
        "report_type",
        "years",
        "amount",
        "index_col",
        "company_name",
        "securities_code",
        "fullname",
        "taxpayer_id",
    ]
    __table_name__ = 'net_ths_listed_company_profit'

    project_name = scrapy.Field()
    currency_unit = scrapy.Field()
    report_type = scrapy.Field()
    years = scrapy.Field()
    amount = scrapy.Field()
    index_col = scrapy.Field()
    company_name = scrapy.Field()
    securities_code = scrapy.Field()
    fullname = scrapy.Field()
    taxpayer_id = scrapy.Field()
